package com.wanmait.recruit.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wanmait.recruit.mapper.ProvinceMapper;
import com.wanmait.recruit.pojo.Province;
import com.wanmait.recruit.service.ProvinceService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service("provinceService")
@Transactional(rollbackFor = Exception.class)
public class ProvinceServiceImpl implements ProvinceService {


    @Resource
    ProvinceMapper provinceMapper;

    @Override
    public void insert(Province object) {

    }

    @Override
    public void delete(Province object) {

    }

    @Override
    public void update(Province object) {

    }

    @Override
    public PageInfo<Province> search(int pageNum,int pageSize) {

        PageHelper.startPage(pageNum,pageSize);
        List<Province> provinces = provinceMapper.findAll();
        PageInfo<Province> pageInfo = new PageInfo<>(provinces);

        return pageInfo;
    }
}
